package com.peisong.service.impl;


import com.peisong.domain.Result;
import com.peisong.domain.Test;
import com.peisong.mapper.TestMapper;
import com.peisong.service.TestService;
import com.peisong.utils.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class TestServiceImpl implements TestService {
    @Autowired
    private TestMapper testMapper;

    @Override
    public Test findByUsername(String username) {
        return testMapper.findByUsername(username);
    }

    @Override
    public void register(String username, String password) {
        testMapper.register(username, Md5Util.getMD5String(password));
    }

    @Override
    public void update(Test test) {
        test.setUpdateTime(LocalDateTime.now());
        testMapper.update(test);
    }
}
